'''
Created on Jul 26, 2011

@author: mike
'''

from PyQt4 import QtCore, QtGui, uic, Qt

class SpinSlider(QtGui.QWidget):
    '''
    classdocs
    '''


    def __init__(self,parent= None):
        '''
        Constructor
        '''
        QtGui.QWidget.__init__(self)
        self.hLayout = QHBoxLayout(self)
        self.slider = QtGui.QSlider()
        self.slider.setOrientation(QtCore.Qt.Horizontal)
        self.slider.setMinimum(-1000.0)
        self.slider.setMaximum(1000.0)
        self.doubleSpinBox = QtGui.QDoubleSpinBox()
        self.doubleSpinBox.setRange(-10000,10000)
        self.hLayout.addWidget(self.doubleSpinBox,0)
        
        self.hLayout.addWidget(self.slider,1)
        
        self.connect(self.slider, QtCore.SIGNAL('valueChanged(int)'), 
            self.changeValue)
        
    def changeValue(self, value):
        self.doubleSpinBox.setValue(value)
        
from PyQt4.Qt import *

import sys
if __name__ == "__main__":
    
    app = QApplication(sys.argv)
    

    c = SpinSlider()

    m = QMainWindow()
    m.setCentralWidget( c)
    m.show()
    app.exec()